﻿using Adnc.Infra.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace WYT.Usr.Repository.Entities
{
    /// <summary>
    /// 用户库存日志
    /// </summary>
    [Table("usr_warehouseLog"), Comment("用户库存日志"), Index(nameof(UserId))]
    public class WarehouseLog : EfEntity
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        [Comment("用户Id")]
        public long UserId { get; set; }

        /// <summary>
        /// 库存Id
        /// </summary>
        [Comment("库存Id")]
        public long WarehouseId { get; set; }

        /// <summary>
        /// 商品ID
        /// </summary>
        [Comment("商品Id")]
        public long GoodsId { get; set; }

        /// <summary>
        /// 规格ID
        /// </summary>
        [Comment("规格Id")]
        public long SizeId { get; set; }

        /// <summary>
        /// 日志类型 1:下级出库 2:自提出库 3:购买入库 4:线下调整入库 5:线上调整出库
        /// </summary>
        [Comment("日志类型 1:下级出库 2:自提出库 3:购买入库 4:线下调整入库 5:线上调整出库")]
        public int Mode { get; set; }

        /// <summary>
        /// 变化类型1：入库，2：出库
        /// </summary>
        [Comment("变化类型1：入库，2：出库")]
        public int ChangeType { get; set; }

        /// <summary>
        /// 云仓类型 0：常规库存 1特殊库存
        /// </summary>
        public int WarehouseType { get; set; }

        /// <summary>
        /// 变化量
        /// </summary>
        [Comment("变化量")]
        public int Count { get; set; }

        /// <summary>
        /// 变化前数量
        /// </summary>
        [Comment("变化前数量")]
        public int ChangeFrontCoun { get; set; }

        /// <summary>
        /// 变化后数量
        /// </summary>
        [Comment("变化后数量")]
        public int ChangeLaterCoun { get; set; }

        /// <summary>
        /// 变化时间
        /// </summary>
        [Comment("变化时间")]
        public DateTime ChangeTime { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [Comment("描述")]
        public string Describe { get; set; }

        /// <summary>
        /// 关联单据ID
        /// </summary>
        [Comment("关联单据ID")]
        public long? OrderId { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        [Comment("操作人")]
        public long? Operator { get; set; }
    }
}
